from sklearn.preprocessing import MinMaxScaler,StandardScaler
import numpy as np
np.random.seed(666)
x=np.random.randn(3,3)*3
y=np.random.randn(4,3)*3
print(x)
#特征缩放
#标准化
sts=StandardScaler()
x_biaozhunhua=sts.fit_transform(x)
print(x_biaozhunhua)
#归一化
mm=MinMaxScaler()
#确定缩放比例
mm.fit(x)
#按照比例缩放
x_guiyihua=mm.transform(x)
y1=mm.transform(y)
#直接按照自身的最大最小值缩放
y_=mm.fit_transform(y)
# x_guiyihua=mm.fit_transform(x)
print(x_guiyihua)
print(y1)
print(y_)